namespace KYO.DAL {
    using System;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    
    public partial class Role : ObjectPersistence.ORNetBaseType {
        public Role() {
        }
        public Role(int RoleId, string Name) {
            this.RoleId = RoleId;
            this.Name = Name;
        }

        public int RoleId {
            get {
                return _RoleId;
            }
            set {
                this._RoleId = value;
                this.ChangesMade = true;
            }
        }
        public string Name {
            get {
                return _Name;
            }
            set {
                this._Name = value;
                this.ChangesMade = true;
            }
        }


        public BusinessLayerHelper.PersistentList<KYO.DAL.User> UserColl {
            get {
                if ((_UserColl == null)) {
                    if (IsNew) {
                        _UserColl = new BusinessLayerHelper.PersistentList<KYO.DAL.User>();
                    }
                    else {
                        ObjectPersistence.RoleAssembler _tempAssem = new ObjectPersistence.RoleAssembler();
                        _UserColl = _tempAssem.GetUserColl(RoleId);
                    }
                }
                return _UserColl;
            }
            set {
                this._UserColl = value;
            }
        }


        private int _RoleId;
        private string _Name;
        private BusinessLayerHelper.PersistentList<KYO.DAL.User> _UserColl;


        public bool IsUserCollNull() {
            return (this._UserColl == null);
        }
        public string ROKeyString {
            get {
                return ("KYO.DAL.Role" + RoleId.ToString());
            }
        }

    }
}
